Skip to content

Update url-status-checker.py #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matteocapricci
Copy link

This pull request introduces a set of functional and structural enhancements to the existing script. The primary objective is to improve the visibility and diagnostic capability of HTTP(S) endpoint checks by incorporating IP:Port resolution and enhanced redirection tracing.
These features were developed as part of a task that required more granular visibility into the behavior and network characteristics of HTTP endpoints.

1) IP:Port Resolution

Introduced a utility function resolve_ip_and_port(url) that resolves the target hostname to its corresponding IP address and determines the port based on URL scheme (http → 80, https → 443, or custom port if specified).
This aids in understanding the actual network endpoint behind each domain and can assist in infrastructure debugging or penetration testing scenarios.

2) Redirection Chain Analysis

URLs that respond with a redirect (e.g., 3xx status codes) now include:

3) Final destination URL

Resolved IP:Port of the redirection target.

This is particularly useful for detecting CDN fronting, load balancing, or domain-level aliasing strategies.

4) Formatted Output Reporting

Output format has been augmented to show:

[Status: 301] [IP: 93.184.216.34:443] https://example.com [Redirect: https://www.example.com (93.184.216.36:443)]
This provides a concise but comprehensive summary per target.

5) Improved Asynchronous Flow

Maintains the use of httpx.AsyncClient with asyncio.as_completed() for efficient concurrent resolution of multiple URLs.

Ensures performance remains scalable with larger URL lists.

6) Graceful Degradation

Robust exception handling ensures that DNS resolution failures or network errors result in a fallback IP:Port Not Found, preserving output consistency without breaking execution.

This new version introduces a set of functional and structural enhancements to the existing StatusChecker.py script. The primary objective is to improve the visibility and diagnostic capability of HTTP(S) endpoint checks by incorporating IP:Port resolution and enhanced redirection tracing.
At the end also the Format Output Reporting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant